package com.example;

import com.alibaba.dubbo.spring.boot.annotation.EnableDubboConfiguration;
import com.example.transaction.TransactionConsume;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
@EnableDubboConfiguration
public class SpringbootDubboConsumerApplication {

    public static void main(String[] args) throws Exception {
        //上下文 对象
        ConfigurableApplicationContext context = SpringApplication.run(SpringbootDubboConsumerApplication.class, args);
//        //注解形式的bean是 类名的首字母小写
//        Consume consume = (Consume) context.getBean("consume");
//        consume.sendMessage("你要好好努力学习");


        TransactionConsume transactionConsume = (TransactionConsume) context.getBean("transactionConsume");
        transactionConsume.sendMessage("1,2,3");


    }

}
